package com.lsu.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lsu.app.bean.Menu;
import com.lsu.app.service.MenuService;
import com.lsu.app.mapper.MenuMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 *
 * @description 针对表【menu】的数据库操作Service实现
 * @Date 2023-10-19 11:21:28
 * @author hjj
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService{
    private  final MenuMapper mapper;

    public MenuServiceImpl(MenuMapper mapper) {
        this.mapper = mapper;
    }

    @Override
    public List<Menu> getTopMenuByRole(String role) {

        return mapper.getTopMenu(mapper.getRoleIdByRole(role));
    }

    @Override
    public List<Menu> getMenusByTopMenusId(Integer menuId) {
        return mapper.getMenusByTopMenusId(menuId);
    }
}




